package com.itchen.hospital.controller;

import com.github.pagehelper.PageInfo;
import com.itchen.hospital.common.Result;
import com.itchen.hospital.pojo.Params;
import com.itchen.hospital.pojo.Patient;
import com.itchen.hospital.pojo.User;
import com.itchen.hospital.service.PatientService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/Patient")
@Tag(name = "患者挂号接口")
public class PatientController {

    @Autowired
    private PatientService patientService;

    @GetMapping("/findBySearch")
    @Operation(summary = "条件查询")
    public Result findBySearch(Params params) {
        PageInfo<Patient> list = patientService.search(params);
        return Result.success(list);
    }

    @GetMapping("/updateStatus")
    @Operation(summary = "叫号")
    public Result update(Patient patient) {
        patientService.update(patient);
        return Result.success();
    }
}
